import {RouteRecordRaw,createRouter,createWebHashHistory} from 'vue-router'
const routes:Array<RouteRecordRaw>=[
    {
        path:'/login',
        component:()=>import('../views/Login.vue')
    },
    {
        path:'/register',
        component:()=>import('../views/Register.vue')
    },
    {
        path:'/',
        component:()=>import('../views/Home.vue'),
        children:[
            {
                path:'hotNewsList',
                component:()=>import('../views/HotNewsList.vue')
            },
            {
                path:'lastNewsList',
                component:()=>import('../views/LastNewsList.vue')
            },
            {
                path:'hotNewsDetail/:hotId',
                component:()=>import('../views/HotNewsDetail.vue')
            },
            {
                path:'lastNewsDetail',
                component:()=>import('../views/LastNewsDetail.vue')
            }
        ]
    }
]
//使用createRouter函数创建路由对象
const router=createRouter({
    routes,
    history:createWebHashHistory()
})
export default router